from django.db import models

#地区模型类
class Area(models.Model):
    name=models.CharField(max_length=20,verbose_name="区域")
    parent=models.ForeignKey('areas.area',on_delete=models.SET_NULL,related_name="subs",null=True,blank=True,verbose_name="上级区域")

    class Meta:
        db_table="tb_areas"

    def __str__(self):
        return self.name